<?php 
//include('../Connections/KRAPPERCON.php');

$sql= "call sp_getClaDocs('".$cladoc."');";
$res = $mysqli->query($sql) or die($mysqli->error.__LINE__);

	if ($res){
		if (isset($_POST['cb_cladoc'])){
			$sel = $_POST['cb_cladoc'];
			while($row = $res->fetch_assoc()){
				$sql = '';
				if ($row['ClaDocID']==$cb_cladoc) $sel='selected="selected"';
				echo "<option ".$sel." value='".$row['ClaDocID']."'>".$row['ClaDocNom']."</option>";	
			}		
		}
		else
		{
			while($row = $res->fetch_assoc()){
				echo "<option value='".$row['ClaDocID']."'>".$row['ClaDocNom']."</option>";	
			}	
		}
		$res->close();
		$mysqli->check_result();
	}

?>